#!/bin/bash

# 接收参数
# $1:播放地址 $2:截图存放地址 $3:截图时间
video_url=$1
save_file=$2
time=$3

if [ -e $time ]; then
	time=1
fi

if [[ $1 == "http"* ]]; then
	video_url=$video_url" live=1"
fi

echo ffmpeg -i \"$video_url\" -y "$save_file" -ss 00:00:0$time -r 1 -vframes 1 -an -vcodec mjpeg

ffmpeg -i "$video_url" -y "$save_file" -ss 00:00:0$time -r 1 -vframes 1 -an -vcodec mjpeg
